<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="zh-CN">

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="referrer" content="always" />

<meta name="keywords" content="网站后台" />
<meta name="description" content="追溯网站后台" />
<title>KTL上下料系统</title>

<link rel="shortcut icon" type="image/x-icon" href="#(ctx)/assets/img/favicon.ico">
<link rel="stylesheet" type="text/css"
	href="#(ctx)/assets/font-awesome/css/font-awesome.min.css">

<link rel="stylesheet" type="text/css"
	href="#(ctx)/assets/css/bootstrap.min-4.3.1.css">
<link rel="stylesheet" type="text/css"
	href="#(ctx)/assets/css/jfinal-com-4.0.css">
</head>

<!--如果不需要悬浮的header 就去掉body上的class-->
<body class="jfa-header-fixed">
	<!--header部分 -->
	<div class="jf-header"
		style="text-align: center; font-size: 32px; color: white;">
		天纳克KTL上下料追溯系统</div>


	<!--主体内容-->
	<div class="jfa-page-container">
		<div class="container" style="margin-top: 30px;">
			<div class="row">
				<div class="col" style="margin-bottom: 20px;">
					<div class="jfa-panel">
						<div class="jf-panel-header">

							<h1 class="jf-login-title">登录</h1>
						</div>

						<div class="jf-panel-body mt15"
							style="width: 500px; margin: 30px auto;">
							<form id="login_form"
								action="#(ctx)/login/doLogin" method="post">
								<div class="form-group row mb-4">
									<label for="userName"
										class="col-sm-2 col-form-label  col-form-label-lg">账号</label>
									<div class="col-sm-10">
										<input class="form-control form-control-lg" id="userName"
											name="userName" placeholder="请输入账号">
									</div>
								</div>
								<div class="form-group row mb-4">
									<label for="password"
										class="col-sm-2 col-form-label  col-form-label-lg">密码</label>
									<div class="col-sm-10">
										<input type="password" autocomplete="off"
											class="form-control form-control-lg" id="password"
											name="password" placeholder="请输入密码">
									</div>
								</div>
								<div class="form-group row mb-4">
									<label class="col-sm-2  col-form-label-lg"> <img
										title="点击刷新" onclick="updateCaptcha(this,'captchaInput')"
										id="captchaImg" class="jf-login-captcha" src="#(ctx)/login/captcha" />
									</label>
									<div class="col-sm-10">
										<input type="text" autocomplete="off"
											class="form-control  form-control-lg" id="captchaInput"
											name="captcha" placeholder="请输入验证码">
									</div>
								</div>

								<div class="form-group row">
									<div class="col-10 offset-2">
										<div class="form-check">
											<input class="form-check-input" name="keepLogin"
												type="checkbox" id="keepLogin" value='1' checked> <label
												class="form-check-label" for="keepLogin"> 保持登录<span
												class="text-danger ml-2">(勿在公用电脑上使用)</span>
											</label>
										</div>
									</div>
								</div>

								<div class="form-group row">
									<div class="col-12 text-right">
										<button type="submit" class="btn btn-primary btn-lg"
											style="padding-left: 20px; padding-right: 20px;">登 录</button>
									</div>
								</div>
							</form>

							<!-- 内容区域  end-->
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<div class="jf-footer">
		<div class="container">
			<ul class="jf-footerlinks">
				<li>常州天纳克减震器</li>
			</ul>
		</div>

		<div class="jf-copyright">
		©EISENMANN-#(date??2019)
		</div>
	</div>

	<script type="text/javascript" src="#(ctx)/assets/jquery/jquery.min-3.3.1.js"></script>
	<script type="text/javascript" src="#(ctx)/assets/js/bootstrap.min-4.3.1.js"></script>
	<script type="text/javascript"
		src="#(ctx)/assets/jquery_form/jquery.form.min.js"></script>
	<script type="text/javascript" src="#(ctx)/assets/layer/layer/layer.js"></script>
	<script type="text/javascript">
		var captchaImg = $("#captchaImg");
		var captchaInputId = "captchaInput";

		$(document).ready(function() {
			$("#login_form").ajaxForm({
				dataType : "json",
				beforeSubmit : function(formData, jqForm, options) {
					// 表单提交之前回调
				},
				success : function(ret) {
					if (ret.state == "ok") {
						location.href = "#(ctx)"+ret.returnUrl;
					} else {
						layer.msg(ret.msg, {
							shift : 6,
							shade : 0.3,
							time : 7000 // 0 为不自动关闭窗口
							,
							offset : "165px",
							closeBtn : 1,
							shadeClose : true
						}, function() {
							updateCaptcha(captchaImg, captchaInputId);
						});
					}
				},
				error : function(ret) {
				} // ret.status != 200 时回调
				,
				complete : function(ret) {
				} // 无论是 success 还是 error，最终都会被回调
			});
		});

		/**
		 * 刷新验证码
		 */
		function updateCaptcha(img, inputId) {
			var src = "#(ctx)/login/captcha?v=" + Math.random();
			if (img.src) {		// 支持传入 this
				img.src = src;
			} else {			// 支持传入 jquery 对象
				img.attr("src", src);
			}
			$("#" + inputId).val("");
		}
	</script>
</body>
</html>
